//Math的各种运算

public class MathPractice {
    public static void main(String[] args) {
        //public static double abs(double num): 取绝对值
        System.out.println((Math.abs(-25)));
        System.out.println((Math.abs(25)));
        System.out.println("~~~~~~~~~~~~~");

        //public static double ceil(double num): 向上取整
        System.out.println((Math.ceil(-2.5)));
        //public static double floor(double num):向下取整
        System.out.println((Math.floor(-2.5)));
        System.out.println("~~~~~~~~~~~~~");

        //public static int max(int a, int b) : 求最大值
        System.out.println((Math.max(25,30)));
        //public static int min(int a, int b) : 求最小值
        System.out.println((Math.min(25,30)));
        System.out.println("~~~~~~~~~~~~~");

        //public static long round(double num): 四舍五入
        System.out.println((Math.round(3.14566)));
        System.out.println((Math.round(-2.55)));
        System.out.println("~~~~~~~~~~~~~");
        //public static double pow(double a, double b):求a的b次幂
        System.out.println((Math.pow(2,10)));
        //public static double random()  : 随机的范围[0,1)
        System.out.println((Math.random()));
        System.out.println("~~~~~~~~~~~~~");
        //Math.PI  -> 圆周率
        System.out.println(Math.PI);

    }
}
